def evclid(a, b):
    if a == b:
        return a

    if a>b:
        return evclid(a-b, b)
    return evclid(a, b-a)

def evclid_up(a, b):
    if b == 0:
        return a
    return evclid_up(b, a%b)

def evclid_up_up(a,b):
    return a if b == 0 else evclid_up_up(b, a%b)

print(evclid_up_up(8, 2))
